package com.woniu.core.service.Impl;


import com.woniu.core.entity.CoreFinanceAuditRecord;
import com.woniu.core.mapper.CoreFinanceAuditRecordMapper;
import com.woniu.core.service.CoreFinanceAuditRecordService;
import com.woniu.util.utils.HttpResult;
import com.woniu.util.utils.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 企业管理
 */
@Service
public class CoreFinanceAuditRecordServiceImpl implements CoreFinanceAuditRecordService {
        @Autowired(required = false)
        private CoreFinanceAuditRecordMapper coreFinanceAuditRecordMapper;

    /**
     * 核心企业审核融资企业记录
     * @param coreFinanceAuditRecordRequestResult 审核信息
     * @return 返回结果
     */
    @Override
    public HttpResult<?> insertCoreFinanceAuditRecord(RequestResult<CoreFinanceAuditRecord> coreFinanceAuditRecordRequestResult) {
        int result = coreFinanceAuditRecordMapper.insert(coreFinanceAuditRecordRequestResult.getData());
        if(result > 0){
            return new HttpResult<>().ok();
        }
             return new HttpResult<>().fail();
    }
    /**
     * 修改核心企业审核融资企业记录
     * @param coreFinanceAuditRecordRequestResult 核心企业审核融资企业记录
     * @return
     */
    @Override
    public HttpResult<?> updateCoreFinanceAuditRecord(RequestResult<CoreFinanceAuditRecord> coreFinanceAuditRecordRequestResult) {
        int result = coreFinanceAuditRecordMapper.updateById(coreFinanceAuditRecordRequestResult.getData());
        if(result > 0){
            return new HttpResult<>().ok();
        }
        return new HttpResult<>().fail();
    }

    @Override
    public HttpResult<?> selectCoreFinanceAuditRecord(RequestResult<CoreFinanceAuditRecord> coreFinanceAuditRecordRequestResult) {
        return null;
    }

    /**
     * 删除核心企业审核融资企业记录
     * @param coreId 核心企业审核融资企业记录id
     * @return
     */
    @Override
    public HttpResult<?> deleteCoreFinanceAuditRecord(Integer coreId) {
        int result = coreFinanceAuditRecordMapper.deleteById(coreId);
        if(result > 0){
            return new HttpResult<>().ok();
        }
        return new HttpResult<>().fail();
    }


}
